package com.limy.api;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class ResultApi {
    private String reason;
    private int code;
    private Object result;
    public  static  ResultApi success(Object result){
        return new ResultApi().setResult(result).setCode(1001).setReason("数据操作成功");
    }

    public  static  ResultApi error(Object result){
        return new ResultApi().setResult(result).setCode(1002).setReason("数据操作失败");
    }
}
